//
//  NSString+Extension.m
//  BonweBuy
//
//  Created by liuxin on 2020/2/26.
//  Copyright © 2020 liuxin. All rights reserved.
//

#import "NSString+Extension.h"


@implementation NSString (Extension)

-(BOOL)isPhone{
    NSString *phoneRegex = @"^(?:\\+?86)?1(?:3\\d{3}|5[^4\\D]\\d{2}|8\\d{3}|7(?:[01356789]\\d{2}|4(?:0\\d|1[0-2]|9\\d))|9[189]\\d{2}|6[567]\\d{2}|4[579]\\d{2})\\d{6}$";
    NSPredicate *phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", phoneRegex];
    return [phoneTest evaluateWithObject:self];
}

@end
